package com.yanyingkun.controller;

import com.yanyingkun.model.Restaurant;
import com.yanyingkun.service.RestaurantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class RestaurantController {

    @Autowired
    private RestaurantService restaurantService;

    @GetMapping("/restaurants")
    public List<Restaurant> getRestaurants() {
        return restaurantService.getAllRestaurants();
    }

    @PostMapping("/restaurants")
    public void addRestaurant(@RequestBody Restaurant restaurant) {
        // 添加新的餐厅
    }
}
